//
//  TeamDetailModel.swift
//  Health-Doctor
//
//  Created by 勇胡 on 2023/12/14.
//  Copyright © 2023 掌上卫健. All rights reserved.
//团队详情模型

import Foundation
import HandyJSON

class TeamDetailModel: NSObject,HandyJSON {
    required override init(){}
    //团队id
    public var teamId = ""
    //团队名称
    public var name = ""
    //队长ID
    public var leaderMemberId = ""
    //团队类型
    public var type = ""
    //是否启用
    public var enable = ""
    //成立时间
    public var establishTime = ""
    //医生列表
    public var memberList:[TeamMember] = []
    //图标
    public var icon = ""
    //机构
    public var jgName = ""
    //团队所属机构ID
    public var jgId = ""
    //创建者ID
    public var cuser = ""
    //创建者
    public var cusername = ""
    //描述
    public var desc = ""
    //服务包
    public var packList:[TeamSpkgModel] = []
    
    func mapping(mapper: HelpingMapper) {
        mapper <<<
            self.desc <-- "description"
    }
    
    //获取责任人，队长
    public func getLeaderName()->String{
        if memberList.isEmpty || leaderMemberId.isEmpty{return ""}
        for member in memberList{
            if member.memberId == leaderMemberId{
                return member.name
            }
        }
        return ""
    }
}
